package com.termdev.droidguard.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;

import com.termdev.droidguard.R;

public class BackupAndRestore extends Activity{
	private Button topBackup;
	private Button topRestore;
	private LinearLayout mContainerBackup;
	private LinearLayout mContainerRestore;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_backup_restore);
		initView();
		
	}
	private void initView(){
		topBackup = (Button)findViewById(R.id.top_backup);
		topBackup.setBackgroundResource(R.drawable.top_tab_button_left_selected);
		topRestore = (Button)findViewById(R.id.top_restore);
		mContainerBackup = (LinearLayout)findViewById(R.id.layout_backup);
		mContainerRestore = (LinearLayout)findViewById(R.id.layout_restore);
		topBackup.setOnClickListener(mListener);
		topRestore.setOnClickListener(mListener);
		//mContainerBackup.setOnClickListener(mListener);
		//mContainerRestore.setOnClickListener(mListener);
	}
	
	private OnClickListener mListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch(v.getId()){
				case R.id.top_backup:
					topBackup.setBackgroundResource(R.drawable.top_tab_button_left_selected);
					topRestore.setBackgroundResource(R.drawable.top_tab_button_right_normal);
					mContainerBackup.setVisibility(View.VISIBLE);
					mContainerRestore.setVisibility(View.GONE);
					
					break;
				case R.id.top_restore:
					topBackup.setBackgroundResource(R.drawable.top_tab_button_left_normal);
					topRestore.setBackgroundResource(R.drawable.top_tab_button_right_selected);
					mContainerBackup.setVisibility(View.GONE);
					mContainerRestore.setVisibility(View.VISIBLE);
					break;
				case R.id.container_backup:
					break;
				case R.id.container_restore:
					break;
			}
		}
	};
}
